#include "mywidget.h"
#include <QPaintEvent>
#include <QPainter>
#include <QImage>
mywidget::mywidget(QWidget *parent) : QWidget(parent)
{
    m_inageScale=QSize(90,80);
    image=new QImage(":/image/avatar0.jpg");

}

void mywidget::paintEvent(QPaintEvent *event)
{
    QPainter painter(this);
    painter.fillRect(event->rect(),QBrush(Qt::black));
    QImage img=image->scaled(m_inageScale,Qt::KeepAspectRatio);
    painter.drawImage(m_imagePos,img);
}
